fix(cli): only claim uipath new scaffolds for langchain agents - #1069
Draft
vldcmp-uipath wants to merge 1 commit into
Draft
fix(cli): only claim uipath new scaffolds for langchain agents#1069vldcmp-uipath wants to merge 1 commit into
vldcmp-uipath wants to merge 1 commit into
Conversation
vldcmp-uipath
force-pushed
the
fix/gate-new-middleware-on-project-type
branch
from
September 9, 2026 11:47
bb51178 to
0fbab93
Compare
vldcmp-uipath
force-pushed
the
fix/gate-new-middleware-on-project-type
branch
2 times, most recently
from
September 11, 2026 12:31
9c98643 to
eba8fe7
Compare
The `new` middleware returned `should_continue=False` for every call, so installing uipath-langchain made the base `uipath new` function scaffold unreachable (UiPath/uipath-python#1543). It now claims a scaffold only when the base CLI asks for one it can serve: `--type auto` (where a single installed integration is meant to win) or `--type agent --agent-framework langchain`. Every other case — `--type function`, or an agent scaffold for another framework — passes through to the next middleware. The gate compares with `==` rather than `is`, so callers passing plain strings (an older uipath, or a direct middleware call) still work. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vldcmp-uipath
force-pushed
the
fix/gate-new-middleware-on-project-type
branch
from
September 11, 2026 12:49
eba8fe7 to
e8f33bd
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Important
Draft until UiPath/uipath-python#1886 is approved and
uipath2.14.15 is published. The middleware importsuipath._cli.models.project_types/uipath._cli.models.agent_frameworks, which only exist from 2.14.15. For dev-build validation and TestPyPI publishing, this PR temporarily pinsuipath==2.14.15.dev1018867615(the dev build of #1886) sourced from thetestpypiindex, withuv.lockresolved against it. Before marking ready for review: restore"uipath>=2.14.15, <2.15.0", drop the[tool.uv.sources]testpypi entry foruipath, and runuv lock.Problem
langgraph_new_middlewarereturnsshould_continue=Falseunconditionally, so installinguipath-langchainhijacksuipath newprocess-wide and the base function scaffold becomes unreachable (UiPath/uipath-python#1543). This also breaks theuip function new -l pypath, which delegates touipath newand expects a function project.Changes
project_type/agent_framework(forwarded byuipath newsince 2.14.15) and claims the command for--type auto(the default: an installed framework wins, preserving today's behaviour) and for--type agentwith thelangchainframework; everything else passes through to the base scaffold or another framework's integration.ProjectType.AGENT/AgentFramework.LANGCHAIN) preserve current behaviour when an olderuipathCLI calls with just the project name.!=rather than identity so callers passing plain strings gate correctly (the enums subclassstr).uipathfloor raised to 2.14.15.Behaviour with uipath >= 2.14.15
uipath new my-fn(or--type auto)uipath new my-fn --type functionuipath new my-agent --type agentuipath new x --type agent --agent-framework pydantic-aiTesting
tests/cli/test_new.py(7 new cases incl. plain-string gating and old-CLI default), mypy and ruff clean, run against the TestPyPI dev builduipath==2.14.15.dev1018867615.🤖 Generated with Claude Code
Development Package
uipath pack --nolockto get the latest dev build from this PR (requires version range).